import http from "@/api/config/http";
import { IQuery, IResponse, ITableResponse } from "@/types/http/IAxios";
import { Scheduled } from "./type";

// 查询下发队列列表
export function jobsList(query?: IQuery): Promise<ITableResponse<any>> {
  return http.request({
    url: "/jobs/jobs/list",
    method: "get",
    params: query
  });
}
// 删除
export function delJobs(ids: string[]): Promise<IResponse<any>> {
  return http.request({
    url: `/jobs/jobs/${ids.join(",")}`,
    method: "delete"
  });
}

// 查询下发队列列表
export function addJobs(data: Scheduled): Promise<IResponse<any>> {
  return http.request({
    url: "/jobs/jobs",
    method: "post",
    data
  });
}
// 查询下发队列列表
export function updateJobs(data: Scheduled): Promise<IResponse<any>> {
  return http.request({
    url: "/jobs/jobs",
    method: "put",
    data
  });
}
